// (C) 2022 Intel Corporation. All rights reserved.
// Your use of Intel Corporation's design tools, logic functions and other 
// software and tools, and its AMPP partner logic functions, and any output 
// files from any of the foregoing (including device programming or simulation 
// files), and any associated documentation or information are expressly subject 
// to the terms and conditions of the Intel Program License Subscription 
// Agreement, Intel FPGA IP License Agreement, or other applicable 
// license agreement, including, without limitation, that your use is for the 
// sole purpose of programming logic devices manufactured by Intel and sold by 
// Intel or its authorized distributors.  Please refer to the applicable 
// agreement for further details.
	
module prochot_memhot
(
// ------------------------
// Clock and Reset signals
// ------------------------
   input       iClk,                                        //clock for sequential logic 
   input       iRst_n,                                      //reset signal from PLL Lock, resets state machine to initial state
// ----------------------------
// inputs and outputs
// ----------------------------
   input 	         iIRQ_CPU0_VRHOT_N,
	input             iIRQ_CPU1_VRHOT_N,
	input             iIRQ_CPU0_MEM_VRHOT_N,
	input             iIRQ_CPU1_MEM_VRHOT_N,
	input             iSYS_THROTTLE_N,
	
	
	output reg        oH_CPU0_PROCHOT_LVC1_R_N,
	output reg        oH_CPU1_PROCHOT_LVC1_R_N,
	output reg        oH_CPU0_MEMHOT_IN_LVC1_R_N,
	output reg        oH_CPU1_MEMHOT_IN_LVC1_R_N

);


////////////////////////////////////////////////////////////
//Internal signals
////////////////////////////////////////////////////////////
   localparam        LOW  = 1'b0;
	localparam        HIGH = 1'b1;

////////////////////////////////////////////////////////////
//Sequencial Logic for PERST
////////////////////////////////////////////////////////////

   always @ (posedge iClk or negedge iRst_n) begin
      if(!iRst_n) begin
	      oH_CPU0_PROCHOT_LVC1_R_N               <= HIGH;
			oH_CPU0_MEMHOT_IN_LVC1_R_N             <= HIGH;
	   end
	  
	   else begin
	      if ((!iIRQ_CPU0_VRHOT_N) || (!iSYS_THROTTLE_N)) begin
		      oH_CPU0_PROCHOT_LVC1_R_N            <= LOW;
		   end
			else begin
			   oH_CPU0_PROCHOT_LVC1_R_N            <= HIGH;
			end
			
			if ((!iIRQ_CPU0_MEM_VRHOT_N) || (!iSYS_THROTTLE_N)) begin
		      oH_CPU0_MEMHOT_IN_LVC1_R_N          <= LOW;
		   end
			else begin
			   oH_CPU0_MEMHOT_IN_LVC1_R_N          <= HIGH;
			end
	   end
   end
  
   always @ (posedge iClk or negedge iRst_n) begin
      if(!iRst_n) begin
	      oH_CPU1_PROCHOT_LVC1_R_N               <= HIGH;
			oH_CPU1_MEMHOT_IN_LVC1_R_N             <= HIGH;
	   end
	  
	   else begin
	      if ((!iIRQ_CPU1_VRHOT_N) || (!iSYS_THROTTLE_N)) begin
		      oH_CPU1_PROCHOT_LVC1_R_N            <= LOW;
		   end
			else begin
			   oH_CPU1_PROCHOT_LVC1_R_N            <= HIGH;
			end
			
			if ((!iIRQ_CPU1_MEM_VRHOT_N) || (!iSYS_THROTTLE_N)) begin
		      oH_CPU1_MEMHOT_IN_LVC1_R_N          <= LOW;
		   end
			else begin
			   oH_CPU1_MEMHOT_IN_LVC1_R_N          <= HIGH;
			end
	   end
   end

endmodule
